﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Light.Framework
{
    /// <summary>
    /// 查询表达式
    /// </summary>
    [Serializable]
    class SearchExpression
    {
        public SearchExpression(SearchLogic logic, string propertyName, object propertyValue)
        {
            Logic = logic;
            Operator = SearchOperator.Eq;
            PropertyName = propertyName;
            PropertyValue = propertyValue;
        }

        public SearchExpression(SearchLogic logic, string propertyName, object propertyValue, SearchOperator optor)
            : this(logic, propertyName, propertyValue)
        {
            Operator = optor;
        }

        /// <summary>
        /// 条件逻辑
        /// </summary>
        public SearchLogic Logic { get; set; }

        /// <summary>
        /// 条件运算符
        /// </summary>
        public SearchOperator Operator { get; set; }

        /// <summary>
        /// 属性名
        /// </summary>
        public string PropertyName { get; set; }

        /// <summary>
        /// 属性值
        /// </summary>
        public object PropertyValue { get; set; }
    }

}
